﻿//
// This file is part of AVSReflector project
// Copyright (C) 2011 Yuan Pengfei
//

using System;
using System.Collections.Generic;
using System.Text;

namespace AVSReflector.Core
{
    public class SequenceDisplayExtension : INode
    {
        public uint video_format;
        public uint sample_range;
        public uint display_horizontal_size;
        public uint display_vertical_size;
        public uint stereo_packing_mode;

        public string[] GetInfo()
        {
            List<string> lines = new List<string>();
            lines.Add("video_format = " + video_format);
            lines.Add("sample_range = " + sample_range);
            lines.Add("display_horizontal_size = " + display_horizontal_size);
            lines.Add("display_vertical_size = " + display_vertical_size);
            lines.Add("stereo_packing_mode = " + stereo_packing_mode);
            return lines.ToArray();
        }

        public static SequenceDisplayExtension Parse(BitStream s)
        {
            SequenceDisplayExtension ret = new SequenceDisplayExtension();
            ret.video_format = s.Read(3);
            ret.sample_range = s.Read(1);
            if (s.Read(1) == 1)
                s.Read(24);
            ret.display_horizontal_size = s.Read(14);
            s.Read(1);
            ret.display_vertical_size = s.Read(14);
            ret.stereo_packing_mode = s.Read(2);
            s.SkipToCode(0x1, 24);
            return ret;
        }
    }
}
